/**
 * 引入主库
 */
import React, { Component } from 'react'

/** 引入路由依赖 sadasdasda */
import {
    HashRouter,
    BrowserRouter as Router,
    Switch,
    Route,
    Redirect
} from 'react-router-dom'

/** 登录页面 */
import Login from './pages/Common/Login'

/** 注册页面 */
import Register from './pages/Common/Register'

/** 合同页面 */
import Agreement from './pages/Common/Agreement'

/** 404页面 */
import NotFound from './pages/Common/NotFound'

/** Home Page */
import HomePage from './pages/Home'

/** 产品详情页面 */
import HomeDetail from './pages/Home/HomeDetail'

// home-detail/HomeDetail vue 用法
// HomeDetail react

/** 关注页面 */
import Follow from './pages/Follow'

/** A店页面 */
import Shop from './pages/Shop'

/** 我 */
import User from './pages/User'

/** 收货地址 */
import Address from './pages/User/Address'

/**
 * 主组件
 */
class App extends Component {
    render() {
        return (
            <Router>
                <Switch>
                    <Route component={Login} path="/login"/>
                    <Route component={Register} path="/register"/>
                    <Route component={Agreement} path="/agreement"/>
                    <Route component={NotFound} path="/404"/>
                    <Route component={HomePage} path="/home" exact/>
                    <Route component={HomeDetail} path="/home/detail/:id"/>
                    <Route component={Follow} path="/follow"/>
                    <Route component={Shop} path="/shop"/>
                    <Route component={User} path="/user" exact/>
                    <Route component={Address} path="/user/address"/>
                    <Redirect from="/" to="/login" exact/>
                    <Redirect to="/404"/>
                </Switch>
            </Router>
        )
    }
}
export default App